//
//  WBNetWorkingManager+Extention.swift
//  WSWeibo
//
//  Created by guojianfeng on 2017/7/19.
//  Copyright © 2017年 guojianfeng. All rights reserved.
//

import Foundation

extension WBNetWorkingManager{
    func statusList(since_id: Int64 = 0, max_id: Int64 = 0, _ completion:@escaping (_ result: [[String: AnyObject]]?, _ isSuccess: Bool)->())  {
        let baseURL = "https://api.weibo.com/2/statuses/public_timeline.json"
        let param = ["since_id": "\(since_id)","max_id": "\(max_id > 0 ? max_id - 1 : 0)"] as [String : AnyObject]
        
        tokenRequest(method: .GET, URLString: baseURL, parameters: param) { (json, isSucess) in
                let result = json?["statuses"] as? [[String: AnyObject]]
                completion(result,isSucess)
        }
    }
}
